(function() {
	console.info("setting start");
	var Settings_rm, root;

	localStorage = chrome.storage.local;
	root = typeof exports !== "undefined" && exports !== null ? exports
			: window;

	root.Settings_rm = Settings_rm = {
		get : function(key) {
			if (key in localStorage) {
				return $.parse(localStorage[key]);
			} else {
				return this.defaults[key];
			}
		},
		set : function(key, value) {
			if (value === this.defaults[key]) {
				return this.clear(key);
			} else {
				return localStorage[key] = $.trim(value);
			}
		},
		clear : function(key) {
			return delete localStorage[key];
		},
		has : function(key) {
			return key in localStorage;
		},
		defaults : {
			todayShow : true,
			totalShow : true,
			stayShow : true,
			other : " 还有一些功能等着再做"
		}
	};

	console.info("setting end");
	console.dir(window.Settings_rm);
}).call(this);
